package Lambda.mydemo1;

import java.util.Arrays;
import java.util.Comparator;

public class Test1 {
    public static void main(String[] args) {
        Integer[] arr = {10, 2, 3, 5, 6, 1, 7, 8};

//        Arrays.sort(arr,(Integer o1, Integer o2) -> {
//                return o2 - o1;
//            }
//        );
        Arrays.sort(arr,(o1,o2) -> o2 - o1);
        System.out.println(Arrays.toString(arr));
    }
}
